package com.ndp.fb.enums;

/**
 * Created by sisi.chen on 2016/4/20.
 */
public enum PlatForm {

    itunes("itunes", 1),
    itunes_ipad("itunes_ipad", 2),
    google_play("google_play", 3),
    website("website", 4),
    Unknow("Unknow", 255);

    private String platForm;
    private Integer key;

    PlatForm(String platForm, Integer key){
        this.platForm = platForm;
        this.key = key;
    }

    public static PlatForm getPlatForm(int key) {
        for (PlatForm c : PlatForm.values()) {
            if (c.key == key) {
                return c;
            }
        }

        return Unknow;
    }

    public static PlatForm getPlatForm(String platForm) {
        for (PlatForm c : PlatForm.values()) {
            if (c.platForm.equals(platForm)) {
                return c;
            }
        }

        return Unknow;
    }

    public String getPlatForm() {
        return platForm;
    }

    public void setPlatForm(String platForm) {
        this.platForm = platForm;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }
}
